package com.itcrowd.ittao.service.data;

public class Product {
		
	private String mName;
	private String mPicUrl;
	private String mQRCode;
	private Price mPrice;
	private ProductStatus mStatus;
	
	public Product(String name, String pic, String qrcode, Price price, ProductStatus status) {
		mName = name;
		mPicUrl = pic;
		mQRCode = qrcode;
		mPrice = price;
		mStatus = status;
	}
	
	public String getName() {
		return mName;
	}
	
	public void setName(String mName) {
		this.mName = mName;
	}
	
	public String getPictureUrl() {
		return mPicUrl;
	}
	
	public String getQRCode() {
		return mQRCode;
	}
	
	public void setQRCode(String mQRCode) {
		this.mQRCode = mQRCode;
	}
	
	public Price getPrice() {
		return mPrice;
	}
	
	public ProductStatus getProductStatus() {
		return mStatus;
	}
	
	public void removePurchaseNumber(int number) {
		mStatus.remove(number);
	}
	
	public void addPurchaseNumber(int number) {
		mStatus.add(number);
	}
	
	public Price getCost() {
		return new Price(mStatus.getCurrentNumber()*mPrice.mNumber, mPrice.mType);
	}
}
